<script setup lang="ts" name="beginnerGuide">
  import { queryNewbieGuideTitleList } from '/@/apis/userApi';
  import { useRequest } from 'vue-request';
  import { ref, onMounted } from 'vue';
  import router from '/@/router';
  const guideList = ref(<any>{});
  onMounted(() => {
    useRequest(queryNewbieGuideTitleList, {
      defaultParams: [{ page: 1, limit: 100 , language: localStorage.getItem('lang')}],
      onSuccess(data: any) {
        guideList.value = data.records;
      },
    });
  });
  const toDetail = (id : any)=> {
    router.push({
      path: '/me/beginnerGuideDetail',
      query : {
        id : id,
      }
    });
  };
</script>
<template>
  <div class="beginnerGuide">
    <AppBar class="app_bar" back :primary="true" :title="$t('BeginnerGuide')" />
    <div class="guide_list">
        <div class="li" @click="toDetail(item.id)" v-for="item in guideList" :key="item.id">
            <p class="title">{{ item.title }}</p>
            <van-icon name="arrow-down" />
        </div>
    </div>
  </div>
</template>
<style lang="scss" scoped>
.beginnerGuide {
  .content {
    padding: 20px 30px;
  }
  .guide_list {
    margin: 30px;
    .li {
      min-height: 120px;
      padding: 30px 32px 30px 32px;
      color: rgba(255, 255, 255, 0.85);
      margin-bottom: 20px;
      display: flex;
      justify-content: space-between;
      background: #242424;
      align-items: center;
      .title {
        width: 91%;
        line-height: 34px;
      }
      .more_icon{
        width: 48px;
        height: 48px;
        img {
          width: 100%;
          height: 100%;
        }
      }
    }
  }
}
</style>
<style lang="scss">
.beginnerGuide  {
}
</style>
